package vip.xiaonuo.modular.xyrelationship.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.version.ApiVersionSwagger;
import vip.xiaonuo.modular.xyrelationship.entity.XyRelationship;
import vip.xiaonuo.modular.xyrelationship.service.XyRelationshipService;
import vip.xiaonuo.sys.core.msg.Result;

import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

@RestController
@Api(tags = "族员关系apis")
@ApiVersionSwagger
@RequestMapping("/relationship")
public class ApiRelationshipController {

    @Autowired
    private XyRelationshipService relationshipService;


    @GetMapping("/findAll")
    @ApiOperation("查询所有族员关系列表")
    public Result<List<XyRelationship>> findAll(){
        return success(relationshipService.list());
    }
}
